<template>
  <div class="ruleDetail">

    <!-- <el-breadcrumb separator="/" style="font-size:16px;height:30px;">
    <el-breadcrumb-item :to="{ path: '/transactionAndCommission' }">交易及佣金</el-breadcrumb-item>
    <el-breadcrumb-item :to="{ path: '/transactionCommissionNewCheck'}" v-show="checkOrEdit == 1">查看</el-breadcrumb-item>
    <el-breadcrumb-item :to="{ path: '/transactionCommissionNewCheck'}" v-show="checkOrEdit == 2">编辑</el-breadcrumb-item>
    <el-breadcrumb-item :to="{ path: '/transactionCommissionNew'}" v-show="checkOrEdit == 3">新建批次</el-breadcrumb-item>
    <el-breadcrumb-item>套餐详情</el-breadcrumb-item>
    </el-breadcrumb> -->
    <div class="wrapper wrapper-content animated fadeInRight" id="app">
        <div class="tabLook" v-if="isExceed&&checkExeedData.length!=0">
            <span :class="tabIndex==0 ? 'active' : '' " @click="tabIndexclick(0)">佣金规则查看</span>
            <span :class="tabIndex==1 ? 'active' : '' " @click="tabIndexclick(1)">超标审核记录</span>
        </div>
        <div v-if="tabIndex==0">
            <h1 class="text-center">佣金套餐详情</h1>
            <hr>
            <ul>
                <li>角色：{{roleFn(form.roleList)}}</li>
                <li>适用楼盘：{{allDev}}</li>
                <li>节点规则名称：{{form.nodeRuleName}}</li>
                <li>经纪人奖励：{{form.isAward == 1?'有':'无'}}</li>
                <li class="returnBroke">佣金类型：{{typeFn(form.brokerageType)}}</li>
                <li class="returnBroke">套餐有效期：{{$format.dateFormat(form.packageStarTime,'yyyy/MM/dd')}} 至
                    {{$format.dateFormat(form.packageEndTime,'yyyy/MM/dd')}}
                </li>
            </ul>
            <hr>
            <ul>
                <li v-if="form.brokerageType == 1 || form.brokerageType == 3" class="returnBroke">
                    前佣公式：{{formulaFn(form.formulaModel[0].formula)}}
                </li>
                <li style="text-indent: 5em" class="returnBroke"
                    v-if="(form.brokerageType == 1 || form.brokerageType == 3) && (form.formulaModel[0].formula == 4 || form.formulaModel[0].formula == 5)">
                    房款税点{{form.formulaModel[0].houseMoneyTaxPoint}}% * 装修款（或其他款项）税点{{form.formulaModel[0].renovationTaxPoint}}%
                </li>
                <li v-if="form.brokerageType == 2 || form.brokerageType == 3" class="returnBroke">
                    后佣公式：{{formulaFn(form.formulaModel[is].formula)}}
                </li>
                <li style="text-indent: 5em" class="returnBroke"
                    v-if="(form.brokerageType == 2 || form.brokerageType == 3) &&
                (form.formulaModel[is].formula == 4 || form.formulaModel[is].formula == 5)">
                    *房款税点{{form.formulaModel[is].houseMoneyTaxPoint}}
                    %*装修款（或其他款项）税点{{form.formulaModel[is].renovationTaxPoint}}%
                </li>
                <li v-if="form.isAward==1" class="returnBroke">
                    经纪人奖励公式：固定金额
                </li>
            </ul>
            <hr>

            <el-form ref="form" :model="form" label-width="150px" label-position="right" >
                <h3 style="padding-left: 40px;">佣金套餐</h3>
                <hr>
                <table border="1" class="el-form-item">
                    <tbody v-for="(x,index) in form.formulaPackage" :key="index">
                    <tr>
                        <td rowspan="4" class="title">套餐{{alpha[index]}}</td>
                        <td class="content" v-if="form.brokerageType == 1 || form.brokerageType == 3">
                            <p>前佣</p>
                            <p v-if="form.formulaModel[0].formula == 1">
                                <span class="pad returnBroke">好生活总收入</span>
                                <span class="pad">{{x.packageModel[0].goodLifePackageAmount}}元/套*</span>
                                <span class="pad1">{{x.packageModel[0].goodLifePercentage}}%</span>
                            </p>
                            <p v-if="form.formulaModel[0].formula == 2">
                                <span class="pad returnBroke">好生活总收入</span>
                                <span class="pad">含税成交价*{{x.packageModel[0].goodLifeProportion}}%/套* </span>
                                <span>{{x.packageModel[0].goodLifePercentage}}</span>
                            </p>

                            <p v-if="form.formulaModel[0].formula == 3">
                                <span class="pad returnBroke">好生活总收入</span>
                                <span class="pad">【含税成交价*{{x.packageModel[0].goodLifeProportion}}%/套</span>
                                <span class="pad1">+ 金额{{x.packageModel[0].goodLifeAmount}}元/套】*</span>
                                <span>{{x.packageModel[0].goodLifePercentage}}%</span>
                            </p>

                            <p v-if="form.formulaModel[0].formula == 4">
                                <span class="pad returnBroke">好生活总收入</span>
                                <span class="pad">不含税成交价</span>
                                <span class="pad1">*{{x.packageModel[0].goodLifeProportion}}%/套</span>
                                <span class="pad1">*{{x.packageModel[0].goodLifePercentage}}%</span>
                            </p>

                            <p v-if="form.formulaModel[0].formula == 5">
                                <span class="pad returnBroke">好生活总收入</span>
                                <span class="pad">【不含税成交价</span>
                                <span class="pad1">*{{x.packageModel[0].goodLifeProportion}}%/套</span>
                                <span class="pad1">+ 金额{{x.packageModel[0].goodLifeAmount}}元/套】</span>
                                <span class="pad1">*{{x.packageModel[0].goodLifePercentage}}%</span>
                            </p>
                            <p v-if="form.formulaModel[0].formula == 6||form.formulaModel[0].formula == 7">
                                <span class="pad returnBroke">好生活总收入</span>
                                <span class="pad">{{x.packageModel[0].goodLifePackageAmount}}元/平米*</span>
                                <span class="pad1">{{x.packageModel[0].goodLifePercentage}}%</span>
                            </p>
                            <p class="radios">
                                <el-form-item label="业绩确认节点：" class="jieyong" required>
                                    {{x.packageModel[0].goodLifeNodeName}}
                                </el-form-item>
                            </p>

                            <hr>
                            <p v-if="form.formulaModel[0].formula == 1">
                                <span class="pad returnBroke" v-if="form.roleList == 3">经纪人分佣</span>
                                <span class="pad returnBroke" v-else-if="form.roleList == 0">网络推客分佣</span>
                                <span v-show="form.roleList != -1">
                                    <span class="pad">{{x.packageModel[0].packageAmount}}元/套</span>
                                    <span class="pad1">*{{x.packageModel[0].brokeragePercentage}}%</span>
                                </span>
                            </p>
                            <p v-if="form.formulaModel[0].formula == 2">
                                <span class="pad returnBroke" v-if="form.roleList == 3">经纪人分佣</span>
                                <span class="pad returnBroke" v-else-if="form.roleList == 0">网络推客分佣</span>
                                <span v-show="form.roleList != -1">
                                    <span class="pad">含税成交价 * {{x.packageModel[0].brokerageProportion}}%/套</span>
                                    <span class="pad1">*{{x.packageModel[0].brokeragePercentage}}%</span>
                                </span>
                            </p>
                            <p v-if="form.formulaModel[0].formula == 3">
                                <span class="pad returnBroke" v-if="form.roleList == 3">经纪人分佣</span>
                                <span class="pad returnBroke" v-else-if="form.roleList == 0">网络推客分佣</span>
                                <span v-show="form.roleList != -1">
                                    <span class="pad">【含税成交价 * {{x.packageModel[0].brokerageProportion}}%/套+</span>
                                    <span class="pad1">金额{{x.packageModel[0].brokerageAmount}}元/套】</span>
                                    <span class="pad1">*{{x.packageModel[0].brokeragePercentage}}%</span>
                                </span>
                            </p>
                            <p v-if="form.formulaModel[0].formula == 4">
                                <span class="pad returnBroke" v-if="form.roleList == 3">经纪人分佣</span>
                                <span class="pad returnBroke" v-else-if="form.roleList == 0">网络推客分佣</span>
                                <span v-show="form.roleList != -1">
                                    <span class="pad">不含税成交价 * {{x.packageModel[0].brokerageProportion}}%/套</span>
                                    <span class="pad1">*{{x.packageModel[0].brokeragePercentage}}%</span>
                                </span>
                            </p>
                            <p v-if="form.formulaModel[0].formula == 5">
                                <span class="pad returnBroke" v-if="form.roleList == 3">经纪人分佣</span>
                                <span class="pad returnBroke" vv-else-if="form.roleList == 0">网络推客分佣</span>
                                <span v-show="form.roleList != -1">
                                    <span class="pad">【含税成交价 * {{x.packageModel[0].brokerageProportion}}%/套+</span>
                                    <span class="pad1">金额{{x.packageModel[0].brokerageAmount}}元/套】</span>
                                    <span class="pad1">*{{x.packageModel[0].brokeragePercentage}}%</span>
                                </span>
                            </p>
                            <p v-if="form.formulaModel[0].formula == 6||form.formulaModel[0].formula == 7">
                                <span class="pad returnBroke" v-if="form.roleList == 3">经纪人分佣</span>
                                <span class="pad returnBroke" v-else-if="form.roleList == 0">网络推客分佣</span>
                                <span v-show="form.roleList != -1">
                                    <span class="pad">{{x.packageModel[0].packageAmount}}元/平米</span>
                                    <span class="pad1">*{{x.packageModel[0].brokeragePercentage}}%</span>
                                </span>
                            </p>
                            <p v-for="(item,index) in x.packageModel[0].brokerageNodes" :key="index" style="margin-left: 70px" class="returnBroke"  v-if="item.nodeName != '回款'">
                                <span>节点{{index+1}}：</span> <span style="margin-left: 15px" >{{item.nodeName}}</span>
                                <span v-if="item.brokeNodeType == 1" style="margin-left: 25px;">{{item.brokeNodeAmount}}%</span>
                                <span v-if="item.brokeNodeType == 2 " style="margin-left: 25px;">{{item.brokeNodeAmount}}元</span>
                                <span style="margin-left: 50px;" v-if="item.upperLimitAmount">上限：{{item.upperLimitAmount}}元</span>
                            </p>
                            <hr v-show="form.roleList != -1">
                            <p v-if="form.formulaModel[0].formula == 1">
                                <span class="pad returnBroke">好生活分佣</span>
                                <span class="pad">{{x.packageModel[0].goodLifeGrantPackageAmount}}</span>
                                <span class="pad1">元/套*</span>
                                <span class="pad1">{{x.packageModel[0].goodLifeGrantPercentage}}%</span>
                            </p>
                            <p v-if="form.formulaModel[0].formula == 2">
                                <span class="pad returnBroke">好生活分佣</span>
                                <span class="pad">含税成交价 * {{x.packageModel[0].goodLifeGrantProportion}}%/套</span>
                                <span class="pad1">*{{x.packageModel[0].goodLifeGrantPercentage}}%</span>
                            </p>
                            <p v-if="form.formulaModel[0].formula == 3">
                                <span class="pad returnBroke">好生活分佣</span>
                                <span class="pad">【含税成交价 * {{x.packageModel[0].goodLifeGrantProportion}}%/套</span>
                                <span class="pad1">+{{x.packageModel[0].goodLifeGrantAmount}}元/套】</span>
                                <span class="pad1">*{{x.packageModel[0].goodLifeGrantPercentage}}%</span>
                            </p>
                            <p v-if="form.formulaModel[0].formula == 4">
                                <span class="pad returnBroke">好生活分佣</span>
                                <span class="pad">不含税成交价 * {{x.packageModel[0].goodLifeGrantProportion}}%/套</span>
                                <span class="pad1">*{{x.packageModel[0].goodLifeGrantPercentage}}%</span>
                            </p>
                            <p v-if="form.formulaModel[0].formula == 5">
                                <span class="pad returnBroke">好生活分佣</span>
                                <span class="pad">【不含税成交价 * {{x.packageModel[0].goodLifeGrantProportion}}%/套</span>
                                <span class="pad1">+{{x.packageModel[0].goodLifeGrantAmount}}元/套】</span>
                                <span class="pad1">*{{x.packageModel[0].goodLifeGrantPercentage}}%</span>
                            </p>
                            <p v-if="form.formulaModel[0].formula == 6||form.formulaModel[0].formula == 7">
                                <span class="pad returnBroke">好生活分佣</span>
                                <span class="pad">{{x.packageModel[0].goodLifeGrantPackageAmount}}</span>
                                <span class="pad1">元/平米*</span>
                                <span class="pad1">{{x.packageModel[0].goodLifeGrantPercentage}}%</span>
                            </p>
                            <hr>
                            <p v-if="form.formulaModel[0].formula == 1">
                                <span class="pad returnBroke">开发商分佣</span>
                                <span class="pad">{{x.packageModel[0].openBusinessGrantPackageAmount}}元/套</span>
                                <span class="pad1">*{{x.packageModel[0].openBusinessGrantPercentage}}%</span>
                            </p>
                            <p v-if="form.formulaModel[0].formula == 2">
                                <span class="pad returnBroke">开发商分佣</span>
                                <span class="pad">含税成交价 * {{x.packageModel[0].openBusinessGrantProportion}}%/套</span>
                                <span class="pad1">*{{x.packageModel[0].openBusinessGrantPercentage}}%</span>
                            </p>
                            <p v-if="form.formulaModel[0].formula == 3">
                                <span class="pad returnBroke">开发商分佣</span>
                                <span class="pad">【含税成交价 * {{x.packageModel[0].openBusinessGrantProportion}}%/套</span>
                                <span class="pad1">+{{x.packageModel[0].openBusinessGrantAmount}}元/套】</span>
                                <span class="pad1">*{{x.packageModel[0].openBusinessGrantPercentage}}%</span>
                            </p>
                            <p v-if="form.formulaModel[0].formula == 4">
                                <span class="pad returnBroke">开发商分佣</span>
                                <span class="pad">不含税成交价 * {{x.packageModel[0].openBusinessGrantProportion}}%/套</span>
                                <span class="pad1">*{{x.packageModel[0].openBusinessGrantPercentage}}%</span>
                            </p>
                            <p v-if="form.formulaModel[0].formula == 5">
                                <span class="pad returnBroke">开发商分佣</span>
                                <span class="pad">【不含税成交价 * {{x.packageModel[0].openBusinessGrantProportion}}%/套</span>
                                <span class="pad1">+{{x.packageModel[0].openBusinessGrantAmount}}元/套】</span>
                                <span class="pad1">*{{x.packageModel[0].openBusinessGrantPercentage}}%</span>
                            </p>
                            <p v-if="form.formulaModel[0].formula == 6||form.formulaModel[0].formula == 7">
                                <span class="pad returnBroke">开发商分佣</span>
                                <span class="pad">{{x.packageModel[0].openBusinessGrantPackageAmount}}元/平米</span>
                                <span class="pad1">*{{x.packageModel[0].openBusinessGrantPercentage}}%</span>
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <td class="content" v-if="form.brokerageType == 2 || form.brokerageType == 3">
                            <p>后佣</p>
                            <p v-if="form.formulaModel[is].formula == 1">
                                <span class="pad returnBroke">好生活总收入</span>
                                <span class="pad">{{x.packageModel[is].goodLifePackageAmount}}元/套</span>
                                <span class="pad1">*{{x.packageModel[is].goodLifePercentage}}%</span>
                            </p>
                            <p v-if="form.formulaModel[is].formula == 2">
                                <span class="pad returnBroke">好生活总收入</span>
                                <span class="pad">含税成交价*{{x.packageModel[is].goodLifeProportion}}%/套</span>
                                <span>* {{x.packageModel[is].goodLifePercentage}}%</span>
                            </p>

                            <p v-if="form.formulaModel[is].formula == 3">
                                <span class="pad returnBroke">好生活总收入</span>
                                <span class="pad">【含税成交价*{{x.packageModel[is].goodLifeProportion}}%/套</span>
                                <span class="pad1">+ 金额{{x.packageModel[is].goodLifeAmount}}元/套】</span>
                                <span>*{{x.packageModel[is].goodLifePercentage}}%</span>
                            </p>

                            <p v-if="form.formulaModel[is].formula == 4">
                                <span class="pad returnBroke">好生活总收入</span>
                                <span class="pad">不含税成交价</span>
                                <span class="pad1">*{{x.packageModel[is].goodLifeProportion}}%/套</span>
                                <span class="pad1">*{{x.packageModel[is].goodLifePercentage}}%</span>
                            </p>

                            <p v-if="form.formulaModel[is].formula == 5">
                                <span class="pad returnBroke">好生活总收入</span>
                                <span class="pad">【不含税成交价</span>
                                <span class="pad1">*{{x.packageModel[is].goodLifeProportion}}%/套</span>
                                <span class="pad1">+ 金额{{x.packageModel[is].goodLifeAmount}}元/套】</span>
                                <span class="pad1">*{{x.packageModel[is].goodLifePercentage}}%</span>
                            </p>
                            <p v-if="form.formulaModel[is].formula == 6||form.formulaModel[is].formula == 7">
                                <span class="pad returnBroke">好生活总收入</span>
                                <span class="pad">{{x.packageModel[is].goodLifePackageAmount}}元/平米</span>
                                <span class="pad1">*{{x.packageModel[is].goodLifePercentage}}%</span>
                            </p>
                            <p class="radios">
                                <el-form-item label="业绩确认节点：" class="jieyong" required>
                                    {{x.packageModel[is].goodLifeNodeName}}
                                </el-form-item>
                            </p>
                            <hr>
                            <p v-if="form.formulaModel[is].formula == 1">
                                <span class="pad returnBroke" v-if="form.roleList == 3">经纪人分佣</span>
                                <span class="pad returnBroke" v-else-if="form.roleList == 0">网络推客分佣</span>
                                <span v-show="form.roleList != -1">
                                    <span class="pad">{{x.packageModel[is].packageAmount}}元/套</span>
                                    <span class="pad1">*{{x.packageModel[is].brokeragePercentage}}%</span>
                                </span>
                            </p>
                            <p v-if="form.formulaModel[is].formula == 2">
                                <span class="pad returnBroke" v-if="form.roleList == 3">经纪人分佣</span>
                                <span class="pad returnBroke" v-else-if="form.roleList == 0">网络推客分佣</span>
                                <span v-show="form.roleList != -1">
                                    <span class="pad">含税成交价 * {{x.packageModel[is].brokerageProportion}}%/套</span>
                                    <span class="pad1">*{{x.packageModel[is].brokeragePercentage}}%</span>
                                </span>
                            </p>
                            <p v-if="form.formulaModel[is].formula == 3">
                                <span class="pad returnBroke" v-if="form.roleList == 3">经纪人分佣</span>
                                <span class="pad returnBroke" v-else-if="form.roleList == 0">网络推客分佣</span>
                                <span v-show="form.roleList != -1">
                                    <span class="pad">【含税成交价 * {{x.packageModel[is].brokerageProportion}}%/套+</span>
                                    <span class="pad1">金额{{x.packageModel[is].brokerageAmount}}元/套】</span>
                                    <span class="pad1">*{{x.packageModel[is].brokeragePercentage}}%</span>
                                </span>
                            </p>
                            <p v-if="form.formulaModel[is].formula == 4">
                                <span class="pad returnBroke" v-if="form.roleList == 3">经纪人分佣</span>
                                <span class="pad returnBroke" v-else-if="form.roleList == 0">网络推客分佣</span>
                                <span v-show="form.roleList != -1">
                                    <span class="pad">不含税成交价 * {{x.packageModel[is].brokerageProportion}}%/套</span>
                                    <span class="pad1">*{{x.packageModel[is].brokeragePercentage}}%</span>
                                </span>
                            </p>
                            <p v-if="form.formulaModel[is].formula == 5">
                                <span class="pad returnBroke" v-if="form.roleList == 3">经纪人分佣</span>
                                <span class="pad returnBroke" v-else-if="form.roleList == 0">网络推客分佣</span>
                                <span v-show="form.roleList != -1">
                                    <span class="pad">【不含税成交价 * {{x.packageModel[is].brokerageProportion}}%/套+</span>
                                    <span class="pad1">金额{{x.packageModel[is].brokerageAmount}}元/套】</span>
                                    <span class="pad1">*{{x.packageModel[is].brokeragePercentage}}%</span>
                                </span>
                            </p>
                            <p v-if="form.formulaModel[is].formula == 6||form.formulaModel[is].formula == 7">
                                <span class="pad returnBroke" v-if="form.roleList == 3">经纪人分佣</span>
                                <span class="pad returnBroke" v-else-if="form.roleList == 0">网络推客分佣</span>
                                <span v-show="form.roleList != -1">
                                    <span class="pad">{{x.packageModel[is].packageAmount}}元/平米</span>
                                    <span class="pad1">*{{x.packageModel[is].brokeragePercentage}}%</span>
                                </span>
                            </p>
                            <p v-for="(item,index) in x.packageModel[is].brokerageNodes" :key="index" style="margin-left: 70px" class="returnBroke">
                                节点{{index+1}}： <span style="margin-left: 15px" >{{item.nodeName}}</span>
                                <span v-if="item.brokeNodeType == 1 && item.nodeName != '回款'" style="margin-left: 25px;">{{item.brokeNodeAmount}}%</span>
                                <span v-if="item.brokeNodeType == 2 && item.nodeName != '回款'" style="margin-left: 25px;">{{item.brokeNodeAmount}}元</span>
                                <span style="margin-left: 50px;" v-if="item.upperLimitAmount">上限：{{item.upperLimitAmount}}元</span>
                            </p>
                            <hr v-show="form.roleList != -1">
                            <p v-if="form.formulaModel[is].formula == 1">
                                <span class="pad returnBroke">好生活分佣</span>
                                <span class="pad">{{x.packageModel[is].goodLifeGrantPackageAmount}}</span>
                                <span class="pad1">元/套*</span>
                                <span class="pad1">{{x.packageModel[is].goodLifeGrantPercentage}}%</span>
                            </p>
                            <p v-if="form.formulaModel[is].formula == 2">
                                <span class="pad returnBroke">好生活分佣</span>
                                <span class="pad1">含税成交价 * {{x.packageModel[is].goodLifeGrantProportion}}%/套</span>
                                <span class="pad1">*{{x.packageModel[is].goodLifeGrantPercentage}}%</span>
                            </p>
                            <p v-if="form.formulaModel[is].formula == 3">
                                <span class="pad returnBroke">好生活分佣</span>
                                <span class="pad">【含税成交价 * {{x.packageModel[is].goodLifeGrantProportion}}%/套</span>
                                <span class="pad1">+{{x.packageModel[is].goodLifeGrantAmount}}元/套】</span>
                                <span class="pad1">*{{x.packageModel[is].goodLifeGrantPercentage}}%</span>
                            </p>
                            <p v-if="form.formulaModel[is].formula == 4">
                                <span class="pad returnBroke">好生活分佣</span>
                                <span class="pad1">不含税成交价 * {{x.packageModel[is].goodLifeGrantProportion}}%/套</span>
                                <span class="pad1">*{{x.packageModel[is].goodLifeGrantPercentage}}%</span>
                            </p>
                            <p v-if="form.formulaModel[is].formula == 5">
                                <span class="pad returnBroke">好生活分佣</span>
                                <span class="pad">【不含税成交价 * {{x.packageModel[is].goodLifeGrantProportion}}%/套</span>
                                <span class="pad1">+{{x.packageModel[is].goodLifeGrantAmount}}元/套】</span>
                                <span class="pad1">*{{x.packageModel[is].goodLifeGrantPercentage}}%</span>
                            </p>
                            <p v-if="form.formulaModel[is].formula == 6||form.formulaModel[is].formula == 7">
                                <span class="pad returnBroke">好生活分佣</span>
                                <span class="pad">{{x.packageModel[is].goodLifeGrantPackageAmount}}</span>
                                <span class="pad1">元/平米*</span>
                                <span class="pad1">{{x.packageModel[is].goodLifeGrantPercentage}}%</span>
                            </p>
                            <hr>
                            <p v-if="form.formulaModel[is].formula == 1">
                                <span class="pad returnBroke">开发商分佣</span>
                                <span class="pad">{{x.packageModel[is].openBusinessGrantPackageAmount}}元/套</span>
                                <span class="pad1">*{{x.packageModel[is].openBusinessGrantPercentage}}%</span>
                            </p>
                            <p v-if="form.formulaModel[is].formula == 2">
                                <span class="pad returnBroke">开发商分佣</span>
                                <span class="pad">含税成交价 * {{x.packageModel[is].openBusinessGrantProportion}}%/套</span>
                                <span class="pad1">*{{x.packageModel[is].openBusinessGrantPercentage}}%</span>
                            </p>
                            <p v-if="form.formulaModel[is].formula == 3">
                                <span class="pad returnBroke">开发商分佣</span>
                                <span class="pad">【含税成交价 * {{x.packageModel[is].openBusinessGrantProportion}}%/套</span>
                                <span class="pad">+{{x.packageModel[is].openBusinessGrantAmount}}元/套】</span>
                                <span class="pad1">*{{x.packageModel[is].openBusinessGrantPercentage}}%</span>
                            </p>
                            <p v-if="form.formulaModel[is].formula == 4">
                                <span class="pad returnBroke">开发商分佣</span>
                                <span class="pad">不含税成交价 * {{x.packageModel[is].openBusinessGrantProportion}}%/套</span>
                                <span class="pad1">*{{x.packageModel[is].openBusinessGrantPercentage}}%</span>
                            </p>
                            <p v-if="form.formulaModel[is].formula == 5">
                                <span class="pad returnBroke">开发商分佣</span>
                                <span class="pad">【不含税成交价 * {{x.packageModel[is].openBusinessGrantProportion}}%/套</span>
                                <span class="pad">+{{x.packageModel[is].openBusinessGrantAmount}}元/套】</span>
                                <span class="pad1">*{{x.packageModel[is].openBusinessGrantPercentage}}%</span>
                            </p>
                            <p v-if="form.formulaModel[is].formula == 6||form.formulaModel[is].formula == 7">
                                <span class="pad returnBroke">开发商分佣</span>
                                <span class="pad">{{x.packageModel[is].openBusinessGrantPackageAmount}}元/平米</span>
                                <span class="pad1">*{{x.packageModel[is].openBusinessGrantPercentage}}%</span>
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <!-- 经纪人奖励 -->
                        <td class="content" v-if="form.roleList[0] == 3 && form.isAward == 1">
                            <p>经纪人奖励</p>
                            <p>
                                <span class="pad returnBroke">奖励来源</span>
                                <span class="pad">{{awardSourcefrom(x.packageModel[is+1].awardSource)}}</span>
                            </p>
                            <p>
                                <span class="pad returnBroke">奖励方式</span>
                                <span class="pad">{{awardTypeway(x.packageModel[is+1].awardType)}}</span>
                            </p>
                            <hr/>
                            <p v-if="form.formulaModel[is+1].formula == 1">
                                <span class="pad returnBroke">{{x.packageModel[is+1].awardSource==2?'好生活总收入':'经纪人奖励合计'}}</span>
                                <span class="pad">{{x.packageModel[is+1].goodLifePackageAmount}}元/套</span>
                            </p>
                            <p class="radios">
                                <el-form-item label="业绩确认节点：" class="jieyong" required>
                                    {{x.packageModel[is+1].goodLifeNodeName}}
                                </el-form-item>
                            </p>

                            <hr>
                            <p>
                                <span class="pad returnBroke">经纪人奖励</span>
                                <span class="pad">{{x.packageModel[is+1].packageAmount}}</span>
                            </p>
                            <p v-for="(item,index) in x.packageModel[is+1].brokerageNodes" :key="index" style="margin-left: 70px" class="returnBroke">
                                节点{{index+1}}： <span style="margin-left: 15px" >{{item.nodeName}}</span>
                                <span style="margin-left: 15px" >{{item.brokeNodeAmount}}</span>
                            </p>

                            <hr>
                            <p>
                                <span class="pad returnBroke">好生活分佣</span>
                                <span class="pad">{{x.packageModel[is+1].goodLifeGrantPackageAmount}}</span>
                            </p>
                            <hr/>
                            <p>
                                <span class="pad returnBroke">开发商分佣</span>
                                <span class="pad">{{x.packageModel[is+1].openBusinessGrantPackageAmount}}</span>
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <td class="content">
                            <p class="pad red">
                                预计总佣金=
                                <span v-if="form.brokerageType == 1 || form.brokerageType == 3">{{hehe(form.brokerageType,form.formulaModel[0].formula,x.packageModel[0])}}</span>
                                <span v-if="form.brokerageType == 3"> + </span>
                                <span v-if="form.brokerageType == 2 || form.brokerageType == 3">{{hehe(form.brokerageType,form.formulaModel[is].formula,x.packageModel[is])}}</span>
                                <span v-if="form.roleList[0] == 3 && form.isAward == 1"> + </span>
                                <span v-if="form.roleList[0] == 3 && form.isAward == 1">{{x.packageModel[is+1].goodLifePackageAmount}}元/套</span>
                            </p>
                            <p>
                                *套餐名称：{{x.packageName}}
                            </p>
                            <p>
                                *套餐说明：{{x.packageExplain}}
                            </p>
                        </td>
                    </tr>
                    </tbody>
                </table>
                <div class="hint el-form-item">
                    <p>说明：关于佣金税费，网络推客按照劳务所得税扣除税点；</p>
                </div>
            </el-form>
        </div>
        <div v-if="tabIndex==1">
            <table class="standardTab">
                <tr>
                    <td>审核状态</td>
                    <td>审核意见</td>
                    <td>角色</td>
                    <td>审核人</td>
                    <td>审核时间</td>
                </tr>
                <tr v-for="(item,index) in checkExeedData" :key="index">
                    <td>{{initCheckStatus(item.checkStatus)}}</td>
                    <td>{{item.content}}</td>
                    <td>{{item.userRole}}</td>
                    <td>{{item.userName}}</td>
                    <td>{{initCheckTime(item.auditTime)}}</td>
                </tr>
            </table>
        </div>
    </div>
  </div>
</template>

<script>
import api from "@/api/apiPath"
export default {
    name:'ruleDetail',
    data(){
        return {
        // checkOrEdit:this.$route.query.checkOrEdit,
        title: '',
        tabIndex:0,
        isExceed:"",//是否超标
        checkExeedData:[],//超标记录
        alpha: '一二三四五六七八九十',
        options: [
            {label: '百分比', value: 1},
            {label: '固定金额', value: 2}
        ],
        awardSources:[
            {label: '开发商返还款', value: 1},
            {label: '后佣回款', value: 2}
        ],
        awardTypes:[
            {label: '购物卡', value: 1},
            {label: '现金', value: 2}
        ],
        // customerFollowId: getValue('customerFollowId'),
        // brokerageNode: getValue('brokerageNode') || "",
        form: {
            roleList: [],
            estateIdList: [],
            brokerageType: 1,
            brokerageNode: [],
            packageStarTime: '',
            packageEndTime: '',
            formulaModel: [{
                brokerageFormulaType: 1,
                renovationTaxPoint: '',
                houseMoneyTaxPoint:"",
                formula: 1
            },{
                brokerageFormulaType: 2,
                renovationTaxPoint: '',
                houseMoneyTaxPoint:"",
                formula: 3
            }],
            formulaPackage: []
        },
        devs:[]
        }
    },
    methods: {
        tabIndexclick(val){
            this.tabIndex=val;
        },
        awardSourcefrom(val){//判断奖励来源
            if(val==1){
                return "开发商-返还款"
            }
            if(val==2){
                return "开发商-回款"
            }
            if(val==5){
                return '前佣-经纪人分佣'
            }
            if(val==6){
                return '后佣-经纪人分佣'
            }
        },
        awardTypeway(val){//判断奖励方式
            if(val==1){
                return "购物卡"
            }
            if(val==2){
                return "现金"
            }
        },
        roleFn(value) {
            let arr = [];
            value.forEach(it => {
                if(it == 3){
                    arr.push('职业经纪人');
                }else if(it == 0){
                    arr.push('网络推客');
                }else if(it == -1){
                    arr.push('自来客');
                }
            });
            return arr.join(',');
        },
        typeFn(value) {
            let obj = {
                "1": '前佣',
                "2": '后佣',
                "3": '前佣+后佣',
            };
            return obj[value];
        },
        nodeFn(value){
            let obj = {
                "1": '认购',
                "2": '签约',
                "3": '回款结佣',
                "5":"草签结佣"
            };
            if (value) {
                return value.map(it => obj[it]).join(',');
            }
            return ""
        },
        formulaFn(value){
            let obj = {
                "1": '固定金额',
                "2": '含税成交价*佣金比例',
                "3": '含税成交价*佣金比例 +金额',
                "4": '不含税成交价*佣金比例',
                "5": '不含税成交价*佣金比例 +金额',
                "6": '建筑面积',
                "7": '套内面积',
            };
            return obj[value];
        },
        loadInfo() {
            this.$axios.post(api.getCustomerFollowBrokerage, {
                customerFollowId:this.$route.query.customerFollowId,
                brokerageNode:this.$route.query.brokerageNode}).then(res => {
                    console.log(res);
                    let {brokerage,estate} = res;
                    brokerage.formulaPackage.forEach(it => {
                        it.packageModel.forEach(item => {
                            let m = item.upperLimitAmount;
                            if(m){
                                item.upperLimitAmount = m.toString();
                            }
                        })
                    });
                    this.form = brokerage;
                    let newcustomeNode=[];//需要赋值的开发商节点
                    let customeNode=[];//去重后的开发商节点
                    for(let i=0,len=brokerage.formulaPackage.length;i<len;i++){
                        let data=brokerage.formulaPackage[i]
                        if(data.exhibitionType == ""){
                            data.exhibitionType=[1,2]
                        }
                        //开发商节点赋值
                        for(let j=0;j<data.packageModel.length;j++){
                            newcustomeNode.push({"value":data.packageModel[j].goodLifeNode,"label":data.packageModel[j].goodLifeNodeName})
                        }
                        //开发商节点去重
                        for(let m=0;m<newcustomeNode.length;m++){
                            let flag=true;
                            for(let n=0;n<customeNode.length;n++){
                                if(newcustomeNode[m].value==customeNode[n].value){
                                    flag=false
                                }
                            }
                            if(flag){
                                customeNode.push(newcustomeNode[m])
                            }
                        }
                        data.customeNode=customeNode
                    }
                    this.devs = estate;

            });
        },

        //生成公式
        hehe(type, formula, pack) {
            let mime = {
                '1': `${pack.goodLifePackageAmount}`,
                '2': `含税成交价 * ${pack.goodLifeProportion}%`,
                '3': `含税成交价 * ${pack.goodLifeProportion}%${pack.goodLifeAmount < 0 ? '' : ' + '}${pack.goodLifeAmount}`,
                '4': `不含税成交价 * ${pack.goodLifeProportion}%`,
                '5': `不含税成交价 * ${pack.goodLifeProportion}%${pack.goodLifeAmount < 0 ? '' : ' + '}${pack.goodLifeAmount}`,
                '6': `${pack.goodLifePackageAmount}`,
                '7': `${pack.goodLifePackageAmount}`,
            };
            if(formula==6||formula==7){
                return mime[formula] + '元/平米'+`*${pack.brokeragePercentage}%`;
            }
            return mime[formula] + '元/套'+`*${pack.brokeragePercentage}%`;
        },
        warn(msg) {
            this.$alert(msg, '提示', {
                type: 'error',
                confirmButtonText: '确定',
            });
        },
        clear(val,index,i){
            if(val == 2){
                this.form.formulaPackage[index].packageModel[i].upperLimitAmount = '';
            }

        }
    },
    mounted() {
        this.loadInfo();
    },
    computed: {
        allDev(){
            return this.devs.map(it => {
                if(it.devId){
                    return `${it.cityName}--${it.devName}`
                }else {
                    return '全部楼盘';
                }
            }).join(',');
        },
        is(){
            if(this.form.brokerageType == 1 || this.form.brokerageType == 2){
                return 0
            }else{
                return 1
            }
        }
    }
}
</script>

<style lang="stylus" scoped>
    .text-center{
        text-align:center;
    }
    ul {
        line-height: 30px;
    }

    table {
        width: 100%;
        border: 1px #ccc solid
    }

    p {
        line-height: 30px;
    }

    td.title {
        text-align: center;
        border:none;
        // padding:0!important;
    }

    td.content {
        padding-left: 100px;
        padding-top: 10px;
    }

    .pad {
        padding-left: 30px;
    }

    .mar {
        margin-right: 30px;
    }

    .grey {
        color: #ccc;
    }

    .red {
        color: #ff0000;
    }
    .hint{background: #f2f2f2;color: #999999;padding: 10px 10px 0;}
    .el-form-item{
        margin-bottom: 22px !important;
        border-collapse:collapse!important;
    }
    .el-form-item__label{
        font-size:30px!important;
    }
    .radios .el-radio-group{
        margin-top: 13px;
    }
    .returnBroke:before{
        content: '*';
        color: #f56c6c;
        margin-right: 4px;
    }
    .tabLook span{
        border:1px solid #ccc;
        padding: 5px 10px;
        cursor: pointer;
    }
    .tabLook span.active{
        background: rgba(26, 188, 156, 1);
        color: #fff;
        border-color:rgba(26, 188, 156, 1);
    }
    .standardTab{
        margin-top: 30px;
        border-bottom: 1px solid #ccc;
        border-left: 1px solid #ccc;
    }
    .standardTab td{
        width: 20%;
        text-align: center;
        height: 38px;
        line-height: 38px;
        border-top: 1px solid #ccc;
        border-right: 1px solid #ccc;
    }

        hr {
            margin-top: 20px;
            margin-bottom: 20px;
            border: 0;
            border-top: 1px solid #ccc;
        }

</style>
<style lang="stylus">
.jieyong{
    .el-form-item__label{
        font-size:16px!important;
        font-weight:700!important;
        width:150px;
        text-align:right;
        // padding-left:30px;
        padding-right:0px;
    }
    .el-form-item__content{
        font-size:16px!important;
    }
}
</style>
